*************************************************************************
***********************Table 2: Baseline Results ************************
*************************************************************************

cd $PATH

use analysis_main.dta, clear

eststo clear
xtset commid WAVE
global score comm denc div econ health house market soc trans edc mart sani

local dependent loggini logtheil logpctratio_p90p10 logpctratio_p75p25

foreach y of local dependent{
eststo: xtreg `y' dd post i.WAVE, fe vce(cluster commid)
eststo: xtreg `y' dd post $score i.WAVE, fe vce(cluster commid)
}

esttab est1 est3 est5 est7 using baseline.tex, b(a2) se(a2) keep(dd post)  ///
		stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. \(R^{2}\)"))  ///
		starlevels(* 0.10 ** 0.05 *** 0.01) mtitles("Gini" "Theil" "P90/P10" "P75/P25")  ///
		label nolines replace fragment prehead("\begin{tabular}{l*{4}{c}} \hline\hline") ///
		posthead("\hline \multicolumn{5}{l}{\textbf{A: Without Controls}} \\ ") 

esttab est2 est4 est6 est8 using baseline.tex,  b(a2) se(a2) keep(dd post)  ///
		stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. \(R^{2}\)"))  ///
		starlevels(* 0.10 ** 0.05 *** 0.01) label fragment append nomtitles nonumbers nolines   ///
		posthead("\hline \multicolumn{5}{l}{\textbf{B: With Controls}} \\") postfoot("\hline \end{tabular}") 




